﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_AdminLogin_3xgf : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        
    }
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        DatabaseProcess dp = new DatabaseProcess();
        String query = "select Email,role FROM User_ where role>1 AND Email = '" + Login1.UserName + "' AND Password_ = '" + Login1.Password + "'";
        DataTable dt = dp.ConnectDataBaseReturnDT(query);

        if (dt.Rows.Count > 0)
        {
            Session["username"] = dt.Rows[0]["Email"].ToString();            
            Session["role"] = dt.Rows[0]["role"].ToString();
            Response.Redirect("~/Admin/Management/AdminManageUser.aspx");
        }
    }
}